package com.example.oasystem.service.impl;

import com.example.oasystem.dao.note.AoaNoteListDao;
import com.example.oasystem.dao.notepaper.AoaNotepaperDao;
import com.example.oasystem.entity.note.AoaNoteList;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class noteServiceImpl {
    @Autowired
    AoaNoteListDao aoaNoteListDao;
    public PageInfo<AoaNoteList> getNoteListLimit(int id, int cid, int typeId, int pageNum, int PageSize) {
        PageHelper.startPage(pageNum, PageSize);
        List<AoaNoteList> allRole = aoaNoteListDao.noteList(id,cid,typeId);
        PageInfo<AoaNoteList> pageInfo = new PageInfo<AoaNoteList>(allRole);
        return pageInfo;
    }
    public PageInfo<AoaNoteList> getNoteListLimitByText(int id,int cid,int typeId,int pageNum, int PageSize,String text){
        PageHelper.startPage(pageNum, PageSize);
        List<AoaNoteList> allRole = aoaNoteListDao.noteListByText(text,id,cid,typeId);
        PageInfo<AoaNoteList> pageInfo = new PageInfo<AoaNoteList>(allRole);
        return pageInfo;
    }

}
